//
//  BIProjectVC.m
//  BIProjectModule
//
//  Created by 杨洋 on 2021/8/18.
//

#import "BIProjectVC.h"

#import <BIToolModule/BINotificationNameDefine.h>

@implementation BIProjectVC

#pragma mark - Life Cycle

- (instancetype)init {
    self = [super init];
    if (self) {
        [self bi_setupViewXXXXXX];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    [self bi_setupViewXXXXXX];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageChanged:) name:BINotificationNameChangeLanguage object:nil];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    // 设置状态栏
    self.statusBarStyle = UIStatusBarStyleDefault;
    self.isStatusBarHidden = NO;
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

#pragma mark - Status Bar

- (BOOL)prefersStatusBarHidden {
    return self.isStatusBarHidden;
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return self.statusBarStyle;
}

#pragma mark - Private Method

/// 名字是为了防止被子类覆写，缺失父类实现
- (void)bi_setupViewXXXXXX {
    self.modalPresentationStyle = UIModalPresentationFullScreen;
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.hidesBottomBarWhenPushed = YES;
}

#pragma mark - Option Replace

- (void)languageChanged:(NSNotification *)notification {
    
}

#pragma mark - Setter

- (void)setIsStatusBarHidden:(BOOL)isStatusBarHidden {
    _isStatusBarHidden = isStatusBarHidden;
    [self setNeedsStatusBarAppearanceUpdate];
}

- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle {
    _statusBarStyle = statusBarStyle;
    [self setNeedsStatusBarAppearanceUpdate];
}

@end
